<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="author" content="zxw1992513@qq.com">
    <meta name="renderer" content="webkit">
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no,minimal-ui">
    <meta http-equiv="cleartype" content="on">
    <link rel="shortcut icon" type="image/x-icon" href="/youju100.ico" />
    <meta name="format-detection" content="telephone=no, email=no, address=no">
    <meta http-equiv="Pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-cache">
    <meta name="apple-mobile-web-app-title" content="solar">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="transparent">
    <meta name="screen-orientation" content="portrait">
    <meta name="x5-orientation" content="portrait">
    <meta name="full-screen" content="yes">
    <meta name="x5-fullscreen" content="true">
    <link rel="stylesheet" href="/assets/plusfang/css/reset.css">
    <link rel="stylesheet" href="/assets/plusfang/css/header-footer.css">
    <link rel="stylesheet" href="/assets/plusfang/css/city-list.css">
    <link rel="stylesheet" type="text/css" href="/assets/plusfang/css/home.css"/>
    <title>优居100</title>
</head>
<body>
    <header>
        <div id="header" class="homepage-wrapper">
            <div class="header-left">
                <a class="udf-icon u-youju" href="/"></a>
                <span class="location"><span class="udf-icon u-dingwei"></span>上海</span>
                <input type="hidden" value="<?php echo $city->area_id;?>" id="showcity" />
                <a href="/" class="index">首页</a>
            </div>
        </div>
    </header>
    <div class="overview" style="background-image: url(<?php echo config_item('photo.plusfang.domain');?>/assets/plusfang/img/banner1.jpg);">
        <div class="cover"></div>
        <div class="banner-search">
                <span class="search-title">搜索房源</span>
                <input type="text" placeholder="请输入你想安家的城市" id="search_fang" />
                <button>go</button>
                <!-- class加"hide"搜索列表消失 -->
                <ul class="search-list hide">
<!--                     <li class="search-item">
                        <p class="building-title"><span class="orange">绿地</span>山水一号</p>
                        <p class="building-detail">地址地址地址地址地址地址地址地址</p>
                    </li> -->
                </ul>
            </div>
    </div>
    <div class="choose-wrapper clearfix">
        <div class="container clearfix">
            <div id="choose" class="clearfix" >
                <div class="area">
                    <span class="text">区域：<span class="city-name"><?php if(isset($query_arr['area'])){ echo $query_arr['area']->name; } else {echo '不限';} ?></span></span>
                    <ul class="city-list clearfix">
                    <?php foreach ($districts as $key => $val) : ?>
                        <?php if($val->disabled) : ?>
                            <li class="city-item" data-class="1" data-area="1"><em><?php e($val->name); ?></em></li>
                        <?php else : ?>
                            <li class="city-item" data-class="1" data-area="1"><a href="<?php e($val->url); ?>" <?php if ($val->url_active) : ?>class="con-select"<?php endif; ?> rel="nofollow"> <?php e($val->name); ?> </a></li>
                        <?php endif; ?>
                    <?php endforeach; ?>
                    </ul>
                </div>
                <div class="attr">
                    <span class="text">楼盘类型：<span class="attr-name"><?php if(isset($query_arr['type'])){ echo $query_arr['type']->name; } else {echo '不限';} ?></span></span>
                    <ul class="attr-list">
                        <?php foreach ($building_type as $key => $val) : ?>
                            <li class="attr-item" data-class="2" data-attr="1">
                            <a href="<?php e($val->url); ?>" <?php if ($val->url_active) : ?>class="con-select"<?php endif; ?> rel="nofollow"> <?php e($val->name); ?> </a>
                            </li>
                        <?php endforeach; ?>  
                    </ul>
                </div>
                <div class="price">
                    <span class="text">价格范围：<span class="price-range"><?php if(isset($query_arr['price'])){ echo $query_arr['price']->name; } else {echo '不限';} ?></span></span>
                    <ul class="price-list clearfix">
                        <?php foreach ($city_price as $key => $val) : ?>
                            <li class="price-item" data-class="3" data-price="1">
                            <a href="<?php e($val->url); ?>" <?php if ($val->url_active) : ?>class="con-select"<?php endif; ?> rel="nofollow"> <?php e($val->name); ?> </a>
                        </li>
                        <?php endforeach; ?>
                    </ul>
                </div>
            </div>
            <a href="<?php echo $list_url;?>" class="reset-choose">重置筛选</a>
            <a href="javascript:;" class="m-choose" onclick="location.href='/fang<?php echo "/{$city_code}?".$current_query; ?>&condition=1'">选择筛选条件</a>
        </div>
        
    </div>
    <div class="content-wrapper">
        <div class="container">
            <div class="rank">
            <?php foreach ($order_arr as $key => $val) : ?>
                <a href="<?php e($val->url); ?>" class="<?php e($val->a_class); ?>"><?php e($val->name); ?></a>
                <?php endforeach; ?>
            </div>
            <ul class="buildings-list">
            <?php if ($buildings) : ?>
            <?php foreach ($buildings as $key => $val) : ?>
                <li class="buildings-item">
                    <a href="<?php if(isset($qd) && !empty($qd)){echo "/building/{$city->code}/{$val->building_id}/campaign?qd={$qd}";}else{echo "/building/{$city->code}/{$val->building_id}/campaign";}  ?>" class="clearfix">
                        <img src="<?php e($val->cover->absolute_url); ?>" alt="" class="pic-review">
                        <div class="buildings-instract">
                            <h2><?php e($val->name); ?></h2>
                            <p class="buildings-price">
                            <?php if($val->price_desc != ''): ?>
                                <span class="orange"><?php echo $val->price_desc; ?></span>元/平米
                            <?php else: ?>
                                <?php if ($val->ave_price != 0): ?>
                                <span> ¥<?php e($val->ave_price); ?></span>元/平米<?php else: ?>价格待定<?php endif; ?>
                            <?php endif; ?>
                            </p>
                            <p class="house-type"><?php e($val->main_hx); ?></p>
                            <p class="buildings-address"><?php if($val->district): ?>[<?php e($val->district->area_name); ?>]<?php endif; ?> <?php e($val->address); ?></p>
                            <div class="tags">
                                <span class="tag-orange"><?php e(building_status_site_name()[$val->status]); ?></span>
                                <?php foreach ($val->tags as $tag) : ?><span><?php e($tag->tag_name); ?></span><?php endforeach; ?>
                            </div>
                        </div>
                    </a>
                </li>
                <?php endforeach; ?>
                <?php else : ?>
                <p style="padding: 20px 0 20px 3%; font-size: 16px;">没有找到楼盘</p>
                <?php endif; ?>

            </ul>
        </div>
        <?php echo $this->pagination->create_links(); ?>
    </div>

    <?php $this->load->view('footer') ?>
<script src="/assets/js/building/jquery-1.11.1.min.js"></script>
<script src="/assets/js/building/common.js"></script>

<script type="text/javascript">
    //弹出城市列表
    $('.banner-search,.city-more').on('click',function () {
    if($(this).find('.city').hasClass('show')){
      $(this).find('.city').removeClass('show')
    }else{
      $(this).find('.city').addClass('show')
    }
    })
    //城市列表上点击空白关闭弹窗代码！
    $(document).mouseup(function(e){
            var _con = $('.city.city2') && $('.search-list');
            if(!_con.is(e.target) && _con.has(e.target).length === 0){
                $('.city').removeClass('show')
                $('.search-list').hide()
            }
        });
    $(document).ready(function() {
        $('.rank a').click(function(event) {
            $(this).addClass('active').siblings().removeClass('active');
        });
        $('#choose .text').click(function(event) {
            $(this).siblings('ul').show();
            $(this).parent().siblings().children('ul').hide();
        });
    });
</script>
</body>
</html>